docs.rs failed to build direct-gui-0.1.26
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
direct-gui-0.1.22
direct-gui
Simple direct rendering GUI controls
Documentation
Usage
Add this to your Cargo.toml
:
[]
= "0.1"
And this to your crate root:
extern crate direct_gui;
Run the examples
On Linux you need the xkb
& wayland
packages as required by minifb
-- sudo apt install libwayland-cursor0 libxkbcommon-dev libwayland-dev
cargo run --example button
cargo run --example label
cargo run --example sprite
Examples
use *;
use *;
let screen_size = ;
// Create a buffer where we will render to
let mut buffer: = vec!;
// Create a new instance of the gui
let mut gui = new;
// Load the sprite of a button
let button_img = gui.load_sprite_from_file.unwrap;
// Create a new button using the sprite loaded before at pixel (20, 10)
gui.register;
// Handle "input events" by pretending that the mouse is hovering over the button.
let cs = ControlState ;
gui.update;
// Finally render the current gui state to the buffer
gui.draw_to_buffer;
Credits
Sprite feature by Hammster
Default font by usr_share